/**
 * Created by Administrator on 2017/4/20.
 */
"use strict";
var fs = require('fs');
var path = require('path');
var formidable = require('formidable');
var gm = require('gm');
var querystring = require('querystring');
//注册模块
var register = require('../controller/register');
//登录模块
var login = require('../controller/login');
//首页
var index = require('../controller/index.js');
//书
var book = require('../controller/book.js');
//分类
var category = require('../controller/category.js');
//书架
var my = require('../controller/my.js');
//目录
var catalog = require('../controller/catalog.js');
//搜索
var search = require('../controller/search.js');
//书评
var forum = require('../controller/forum.js');
/*书籍阅读*/
var look = require('../controller/look.js');
/*个人用户*/
var user = require('../controller/user.js');
/*后台管理*/
var rank = require('../controller/rank.js');
/*排行榜*/
var system = require('../controller/system.js');
var ccapart=[];

/*登录注册*/
//注册
exports.register=register.register;
exports.doRegister=register.doReg;
//get注册的验证码
exports.recode=register.recode;
exports.doRecode=register.doRecode;
//登录
exports.login=login.login;
exports.doLogin=login.doLogin;
//get登录的验证码
exports.loginCode=login.loginCode;
//post登录的验证码
exports.doLoginCode=login.doLoginCode;
/*登录注册*/

/*分类*/
exports.categoryKey=category.categoryKey;
exports.categoryDefail=category.categoryDefail;
exports.categoryMale=category.categoryMale;
exports.getCateSubBook=category.getCateSubBook;
exports.getCateBook=category.getCateBook;
exports.getmaleCate=category.getmaleCate;
/*分类*/

/*搜索*/
exports.search=search.search;
exports.getSearchBook=search.getSearchBook;
exports.getSearchBookKeyUp=search.getSearchBookKeyUp;
exports.setHotsearch=search.setHotsearch;
exports.allSearch=search.allSearch;
/*搜索*/

/*首页*/
//获取轮播图
exports.getautoPlay=index.getautoPlay;
//获取首页书本
exports.getrmxsBook=index.getrmxsBook;
exports.getrxbBook=index.getrxbBook;
exports.getfybBook=index.getfybBook;
exports.getypbBook=index.getypbBook;
exports.gettjbBook=index.gettjbBook;
exports.getxsqxBook=index.getxsqxBook;
exports.getqxwbBook=index.getqxwbBook;
exports.getxsmfBook=index.getxsmfBook;
exports.getxhqhBook=index.getxhqhBook;
exports.getxxwxBook=index.getxxwxBook;
exports.getdszcBook=index.getdszcBook;
exports.getlsjsBook=index.getlsjsBook;
exports.getyxtyBook=index.getyxtyBook;
exports.getkhlyBook=index.getkhlyBook;
exports.getecyBook=index.getecyBook;
/*首页*/

/*排行榜*/
exports.rankKey=rank.rankKey;
exports.rankMaleKey=rank.rankMaleKey;
exports.getProminent=rank.getProminent;
exports.getRankBookCount=rank.getRankBookCount;
exports.getRankBook=rank.getRankBook;
/*排行榜*/

/*书*/
//书本详情
exports.bookKey=book.bookKey;
//获取书本信息
exports.getbookInfo=book.getbookInfo;
//获取用户信息
exports.getuserHeadimg=book.getuserHeadimg;
//获取粉丝打赏信息
exports.getariaFansNum=book.getariaFansNum;
//获取粉丝打赏数
exports.getariaFansNums=book.getariaFansNums;

exports.getBookTicket=book.getBookTicket;
//获取粉丝排行榜
exports.getuserTicket=book.getuserTicket;
//加入书架
exports.setBookShelf=book.setBookShelf;
//获取是否已经加入书架
exports.getBookshelfType=book.getBookshelfType;
//点击数
exports.getBookClickNum=book.getBookClickNum;
/*书*/

/*书评*/
exports.forumKey=forum.forumKey;
exports.threadKey=forum.threadKey;
exports.commentKey=forum.commentKey;
//获取全部书评列表
exports.getforumList=forum.getforumList;
//获取全部书评数量
exports.getforumCount=forum.getforumCount;
//获取书评内容
exports.addForumCnt=forum.addForumCnt;
//获取热门书评
exports.getforumHot=forum.getforumHot;
//获取热门书评列表
exports.getforumHotList=forum.getforumHotList;
//获取书评详情
exports.getForumInfo=forum.getForumInfo;
//获取书评详情数量
exports.getForumUserCount=forum.getForumUserCount;
//获取书评详情用户列表
exports.getForumUserList=forum.getForumUserList;
//书评详情回复
exports.addForumUserCnt=forum.addForumUserCnt;
/*书评*/

/*目录*/
exports.catalogKey=catalog.catalogKey;
exports.getChapter=catalog.getChapter;
exports.setBookChapter=catalog.setBookChapter;
/*目录*/

/*书架*/
exports.ticketKey=my.tickeKey;
exports.bookcase=my.bookcase;
exports.removeBookcase=my.removeBookcase;
exports.addBookShelf=my.addBookShelf;
exports.moveBookShelf=my.moveBookShelf;
exports.bookshelfKey=my.bookshelfKey;
/*书架*/

/*书籍阅读*/
exports.lookKey=look.lookKey;
exports.getChapterObj=look.getChapterObj;
exports.getChapterText=look.getChapterText;
/*书籍阅读*/

/*用户*/
exports.user=user.user;
exports.userAccount=user.userAccount;
exports.userMsg=user.userMsg;
exports.userInfo=user.userInfo;
exports.userInfoHeadImg=user.userInfoHeadImg;
exports.addSetMonth=user.addSetMonth;
exports.addSetRecomm=user.addSetRecomm;
exports.addSetReward=user.addSetReward;
exports.getMonthList=user.getMonthList;
exports.getRecommList=user.getRecommList;
exports.getRewardList=user.getRewardList;
exports.updateHeadImg=user.updateHeadImg;
exports.setUserInfo=user.setUserInfo;
exports.getMsgUserCount=user.getMsgUserCount;
exports.getMsgUserPinglun=user.getMsgUserPinglun;
exports.getMsgUserSubCount=user.getMsgUserSubCount;
exports.getMsgUserHuifu=user.getMsgUserHuifu;
exports.getMsgUserList=user.getMsgUserList;
/*用户*/

/*后台管理*/
exports.systemLogin=system.systemLogin;
exports.getSystemMenu=system.getSystemMenu;
exports.getSystemEditMenu=system.getSystemEditMenu;
exports.getAllBookInfo=system.getAllBookInfo;
exports.getSubCate=system.getSubCate;
exports.setAddBook=system.setAddBook;
exports.getAuthors=system.getAuthors;
exports.setAddAuthor=system.setAddAuthor;
exports.authorUpdateImg=system.authorUpdateImg;
exports.setEditAuthor=system.setEditAuthor;
exports.removeAuthor=system.removeAuthor;
exports.BookUpdateImg=system.BookUpdateImg;
exports.removeBook=system.removeBook;
exports.setEditBook=system.setEditBook;
exports.getSelectBooks=system.getSelectBooks;
exports.getChapters=system.getChapters;
exports.setAddChapter=system.setAddChapter;
exports.setEditChapter=system.setEditChapter;
exports.removeChapter=system.removeChapter;
exports.setAddMenuOne=system.setAddMenuOne;
exports.removeSystemMenu=system.removeSystemMenu;
exports.setAddMenuTwo=system.setAddMenuTwo;
exports.editSystemMenu=system.editSystemMenu;
exports.getBooks=system.getBooks;
/*后台管理*/
exports.getLogin=system.getLogin;
//后台退出
exports.sysDoExit=function(req,res){
    req.session.susername=false;
    req.session.aid=false;
    res.json({code:1,msg:'退出成功'});
};
//退出
exports.doExit=function(req,res){
    req.session.username=false;
    req.session.uid=null;
    res.redirect('/');
};
